package edu.yngsxy.wkstudy.core.sys.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import edu.yngsxy.wkstudy.core.model.entity.WkBaseEntity;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;
import jakarta.validation.constraints.*;
import io.swagger.v3.oas.annotations.media.Schema;
/**
 * <p>
 * 章节表
 * </p>
 *
 * @author group 2
 * @since 2025-09-09
 */
@Getter
@Setter
@ToString
@TableName("chapter")
@Accessors(chain = true)
@Schema(description = "章节表")
public class Chapter extends WkBaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 章节ID
     */
    @TableField(value = "chapter_id")
    @Schema(title = "章节ID", description = "章节ID", requiredMode =Schema.RequiredMode.REQUIRED)
    @NotNull(message = "章节ID不能为空")
    private Integer chapterId;

    /**
     * 章节标题
     */
    @TableField("chapter_title")
    @Schema(title = "章节标题", description = "章节标题", requiredMode =Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "章节标题不能为空")
    @Size(max = 200, message = "章节标题长度不能超过200个字符")
    private String chapterTitle;

    /**
     * 章节内容
     */
    @TableField("content")
    @Schema(title = "章节内容", description = "章节内容", requiredMode =Schema.RequiredMode.NOT_REQUIRED)
    @Size(max = 65535, message = "章节内容长度不能超过65535个字符")
    private String content;

    /**
     * 课程ID（外键，关联Course）
     */
    @TableField("course_id")
    @Schema(title = "课程ID（外键，关联Course）", description = "课程ID（外键，关联Course）", requiredMode =Schema.RequiredMode.NOT_REQUIRED)
    private Integer courseId;

    /**
     * 章节顺序（用于排序）
     */
    @TableField("chapter_order")
    @Schema(title = "章节顺序（用于排序）", description = "章节顺序（用于排序）", requiredMode =Schema.RequiredMode.NOT_REQUIRED)
    private Integer chapterOrder;
}
